import { FindManyOptions } from "typeorm";
import { AppDataSource } from "../data-source";
import { Tag } from "../entities/tag";

export class TagService {
  private static readonly tagRepository = AppDataSource.getRepository(Tag);

  public static async find(
    options: FindManyOptions<Tag>,
  ): Promise<[Tag[], number]> {
    return this.tagRepository.findAndCount(options);
  }
}
